﻿Public Class frmBuilder

    Private Sub frmBuilder_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        Output.Print("-------------------------")
        Output.Print("--Patrón Builder:")
    End Sub
    Private Sub btnPeugeot206_Click(sender As System.Object, e As System.EventArgs) Handles btnPeugeot206.Click
        Dim fact As New Automotriz()
        fact.setAutoBuilder(New Peugeot206AutoBuilder())
        fact.ConstruirAuto()

        Dim a As Auto = fact.getAuto()
        Output.Print(String.Format("Auto Peugeot206 creado: {0}, {1}, {2}", a.Ruedas, a.Puertas, a.Motor))
    End Sub

    Private Sub btnAudiTT_Click(sender As System.Object, e As System.EventArgs) Handles btnAudiTT.Click
        Dim fact As New Automotriz()
        fact.setAutoBuilder(New AudiTTAutoBuilder())
        fact.ConstruirAuto()
        Dim a As Auto = fact.getAuto()
        Output.Print(String.Format("Auto Audi TT creado: {0}, {1}, {2}", a.Ruedas, a.Puertas, a.Motor))
    End Sub

    Private Sub btnAstra_Click(sender As System.Object, e As System.EventArgs) Handles btnAstra.Click
        Dim fact As New Automotriz()
        fact.setAutoBuilder(New ChevroletAstaAutoBuilder())
        fact.ConstruirAuto()
        Dim a As Auto = fact.getAuto()
        Output.Print(String.Format("Auto Astra creado: {0}, {1}, {2}", a.Ruedas, a.Puertas, a.Motor))
    End Sub
End Class